<?php

namespace Database\Seeders;

use App\Models\ChatMessage;
use App\Models\Domain;
use App\Models\Team;
use App\Models\User;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class ChatMessageSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $user = User::find(1);
        $domain = Domain::find(1);
        $team = Team::find(1);

        $user->chatMessages()->create([
            'message_parent_model_id' => $domain->id,
            'message_parent_model_type' => Domain::class,
            'text' => 'You may occasionally need to add query constraints based on the "type" of the related polymorphic model. The closure passed to the whereHasMorph method may receive a $type value as its second argument'
        ]);

        $user->chatMessages()->create([
            'message_parent_model_id' => $domain->id,
            'message_parent_model_type' => Domain::class,
            'text' => 'You may occasionally need to add query constraints based on the "type" of the related polymorphic model. The closure passed to the whereHasMorph method may receive a $type value as its second argument'
        ]);

        $user->chatMessages()->create([
            'message_parent_model_id' => $team->id,
            'message_parent_model_type' => Team::class,
            'text' => 'You may occasionally need to add query constraints based on the "type" of the related polymorphic model. The closure passed to the whereHasMorph method may receive a $type value as its second argument'
        ]);

        $user->chatMessages()->create([
            'message_parent_model_id' => $team->id,
            'message_parent_model_type' => Team::class,
            'text' => 'You may occasionally need to add query constraints based on the "type" of the related polymorphic model. The closure passed to the whereHasMorph method may receive a $type value as its second argument'
        ]);

    }
}
